﻿using System;
using System.Collections.Generic;
using System.Text;

using H2.NET.Data.Common;
using H2.NET.Data.Common.Mappings;
using H2.NET.Data.Common.Validates;

namespace H2.NET.Business
{
    [Table]
    [Serializable]
    public partial class mdc_Bom_Sefi_1 : DataObject
    {
        [ID]
        [DID]
        public string ID { get { return _ID; } set { _ID = value; EntityState.FieldChange("ID"); } }
        private string _ID;
        public static FieldInfo id = new FieldInfo("mdc_Bom_Sefi_1", "ID");

        [Column]
        public string Process { get { return _Process; } set { _Process = value; EntityState.FieldChange("Process"); } }
        private string _Process;
        public static FieldInfo process = new FieldInfo("mdc_Bom_Sefi_1", "Process");

        [Column]
        public int Incident { get { return _Incident; } set { _Incident = value; EntityState.FieldChange("Incident"); } }
        private int _Incident;
        public static FieldInfo incident = new FieldInfo("mdc_Bom_Sefi_1", "Incident");

        [Column]
        public string UserName { get { return _UserName; } set { _UserName = value; EntityState.FieldChange("UserName"); } }
        private string _UserName;
        public static FieldInfo userName = new FieldInfo("mdc_Bom_Sefi_1", "UserName");

        [Column]
        public int No { get { return _No; } set { _No = value; EntityState.FieldChange("No"); } }
        private int _No;
        public static FieldInfo no = new FieldInfo("mdc_Bom_Sefi_1", "No");

        [Column]
        public string Sheet_NO { get { return _Sheet_NO; } set { _Sheet_NO = value; EntityState.FieldChange("Sheet_NO"); } }
        private string _Sheet_NO;
        public static FieldInfo sheet_no = new FieldInfo("mdc_Bom_Sefi_1", "Sheet_NO");

        [Column]
        public string Material { get { return _Material; } set { _Material = value; EntityState.FieldChange("Material"); } }
        private string _Material;
        public static FieldInfo material = new FieldInfo("mdc_Bom_Sefi_1", "Material");

        

        [Column]
        public string Alternative_BOM { get { return _Alternative_BOM; } set { _Alternative_BOM = value; EntityState.FieldChange("Alternative_BOM"); } }
        private string _Alternative_BOM;
        public static FieldInfo alternative_bom = new FieldInfo("mdc_Bom_Sefi_1", "Alternative_BOM");

        [Column]
        public string Alternative_TXT { get { return _Alternative_TXT; } set { _Alternative_TXT = value; EntityState.FieldChange("Alternative_TXT"); } }
        private string _Alternative_TXT;
        public static FieldInfo alternative_txt = new FieldInfo("mdc_Bom_Sefi_1", "Alternative_TXT");

        [Column]
        public string BOM_Usage { get { return _BOM_Usage; } set { _BOM_Usage = value; EntityState.FieldChange("BOM_Usage"); } }
        private string _BOM_Usage="S";
        public static FieldInfo bom_usage = new FieldInfo("mdc_Bom_Sefi_1", "BOM_Usage");

        [Column]
        public string Lot_Size { get { return _Lot_Size; } set { _Lot_Size = value; EntityState.FieldChange("Lot_Size"); } }
        private string _Lot_Size;
        public static FieldInfo lot_size = new FieldInfo("mdc_Bom_Sefi_1", "Lot_Size");

        [Column]
        public string Base_Quantity { get { return _Base_Quantity; } set { _Base_Quantity = value; EntityState.FieldChange("Base_Quantity"); } }
        private string _Base_Quantity;
        public static FieldInfo base_Quantity = new FieldInfo("mdc_Bom_Sefi_1", "Base_Quantity");
        
        [Column]
        public string BOM_Status { get { return _BOM_Status; } set { _BOM_Status = value; EntityState.FieldChange("BOM_Status"); } }
        private string _BOM_Status;
        public static FieldInfo bom_status = new FieldInfo("mdc_Bom_Sefi_1", "BOM_Status");

        [Column]
        public string Valid_From { get { return _Valid_From; } set { _Valid_From = value; EntityState.FieldChange("Valid_From"); } }
        private string _Valid_From;
        public static FieldInfo valid_from = new FieldInfo("mdc_Bom_Sefi_1", "Valid_From");

        [Column]
        public string Plant 
        { 
            get 
            {
                if (this.Process == "PKG Sefi Code BOM Application")
                {
                    _Plant = "K15P";
                }
                
                return _Plant; 
            } 
            set { _Plant = value; EntityState.FieldChange("Plant"); } 
        }
        private string _Plant;
        public static FieldInfo plant = new FieldInfo("mdc_Bom_Sefi_1", "Plant");

        [Column]
        [NowDate]
        public DateTime Time { get { return _Time; } set { _Time = value; EntityState.FieldChange("Time"); } }
        private DateTime _Time;
        public static FieldInfo time = new FieldInfo("mdc_Bom_Sefi_1", "Time");

        [Column]
        [DefaultInt(0)]
        public int Status { get { return _Status; } set { _Status = value; EntityState.FieldChange("Status"); } }
        private int _Status;
        public static FieldInfo status = new FieldInfo("mdc_Bom_Sefi_1", "Status");
    }
}
